import request from '@/utils/request'
import { adminModulePrefix } from '../../config'
export function fetchList(query) {
  return request({
    url: `${adminModulePrefix}/user/page`,
    method: 'get',
    params: query
  })
}

export function delObj(id) {
  return request({
    url: `${adminModulePrefix}/user/id/` + id,
    method: 'delete'
  })
}

export function getObj(id) {
  return request({
    url: `${adminModulePrefix}/user/id/` + id,
    method: 'get'
  })
}
export function putObj(obj) {
  return request({
    url: `${adminModulePrefix}/user`,
    method: 'put',
    data: obj
  })
}
export function addObj(obj) {
  return request({
    url: `${adminModulePrefix}/user`,
    method: 'post',
    data: obj
  })
}
/** 实时验证当前登陆用户密码 */
export function checkPassword(obj) {
  return request({
    url: `${adminModulePrefix}/user/checkPassword`,
    method: 'get',
    params: obj
  })
}
/** 登陆用户修改信息 */
export function updateByLoginUser(obj) {
  return request({
    url: `${adminModulePrefix}/user/updateByLoginUser`,
    method: 'post',
    data: obj
  })
}
/** 批量解冻账户状态 */
export function thawAccount(obj) {
  return request({
    url: `${adminModulePrefix}/user/thawAccount`,
    method: 'post',
    data: obj
  })
}
